<?php
namespace Admin\Controller;
use Think\Controller;
class MainController extends Controller {
    public function main(){
        $group = session('depname');
        if($group=='综合办公室'){
            $this->redirect('Main/zh');
        }
        if($group=='市场拓展部'){
            $this->redirect('Main/sc');
        }
        if($group=='人事办公室'){
            $this->redirect('Main/hr');
        }
        session_unset();
        session_destroy();
        $this->error('你未被授权！',U('Index/index'));
        $this->display();
    }
    public function  hr(){
        $data['url'] = $_SERVER["PATH_INFO"];
        if (in_array($data, control())) {
            $this->error('人事部功能您不能操作');
        }
        $this->display();
    }
    public function  sc(){
      $data['url'] = $_SERVER["PATH_INFO"];
        if(in_array($data , control())){
            $this->error('市场部功能您不能操作');
        }
        $this->display();
    }
}